#设置cmake最低版本
cmake_minimum_required(VERSION 3.4.1)

#设置项目名称
project(tst_qtmultimedia_auto_unit_multimedia)

#引入add_module模板文件
include(${ISSQTTESTROOTDIR}/cmake/add_module.cmake)

#设置测试类型，auto为自动测试，manual为手动测试,即test目录下的文件夹名
set(TEST_TYPE auto/unit)
#设置模块名
set(MODULE qtmultimedia)
#设置需要链接的模块
set(LinkQt Core Widgets Multimedia MultimediaWidgets Quick Qml OpenGL)
#设置需要链接的模块的私有模块
set(LinkQtPrivate Multimedia MultimediaWidgets)

set(CodeRootPath ${ISSQTTESTROOTDIR}/qtmultimedia)
include_directories(${CodeRootPath}/src/multimedia
                    ${CodeRootPath}/src/multimedia/audio
                    ${CodeRootPath}/src/multimedia/video
                    ${CodeRootPath}/src/multimedia/controls
                    ${CodeRootPath}/tests/auto/unit/qmultimedia_common)

set(TEST_ITEMS ${TEST_ITEMS}
    qabstractvideobuffer
    qabstractvideosurface
    qaudiorecorder
    qaudioformat
    qaudionamespace
    qcamera
    qcamerainfo
    qcameraimagecapture
    qmediabindableinterface
    qmediacontainercontrol
    qmediacontent
    qmediaobject
    qmediaplayer
    qmediaplaylist
    qmediaplaylistnavigator
    qmediapluginloader
    qmediarecorder
    qmediaresource
    qmediaservice
    qmediaserviceprovider
    qmediatimerange
    qmetadatareadercontrol
    qmetadatawritercontrol
    qradiodata
    qradiotuner
    qvideoencodersettingscontrol
    qvideoframe
    qvideosurfaceformat
    # qwavedecoder             private test
    qaudiobuffer
    qaudiodecoder
    qaudioprobe
    qvideoprobe
    qsamplecache
    # qdeclarativeaudio        private test
    qcameraviewfinder
    qcamerawidgets
    qmediaplayerwidgets
    qmultimedia_common
)

# 定义需要手动处理 MOC 的头文件
set(MANUAL_MOC_HEADERS
    qmultimedia_common/mockmediaserviceprovider.h
    qmultimedia_common/mockmediaservice.h
    qmultimedia_common/mockmediaobject.h
    qmultimedia_common/mockavailabilitycontrol.h
    qmultimedia_common/mockmediarecorderservice.h
    qmultimedia_common/mockmediarecordercontrol.h
    qmultimedia_common/mockvideoencodercontrol.h
    qmultimedia_common/mockaudioencodercontrol.h
    qmultimedia_common/mockaudioinputselector.h
    qmultimedia_common/mockaudioprobecontrol.h
    qmultimedia_common/mockcameraservice.h
    qmultimedia_common/mockcameraflashcontrol.h
    qmultimedia_common/mockcameralockscontrol.h
    qmultimedia_common/mockcamerafocuscontrol.h
    qmultimedia_common/mockcamerazoomcontrol.h
    qmultimedia_common/mockcameraimageprocessingcontrol.h
    qmultimedia_common/mockcameraimagecapturecontrol.h
    qmultimedia_common/mockcameraexposurecontrol.h
    qmultimedia_common/mockcameracapturedestinationcontrol.h
    qmultimedia_common/mockcameracapturebuffercontrol.h
    qmultimedia_common/mockimageencodercontrol.h
    qmultimedia_common/mockcameracontrol.h
    qmultimedia_common/mockvideodeviceselectorcontrol.h
    qmultimedia_common/mockcamerainfocontrol.h
    qmultimedia_common/mockcameraviewfindersettingscontrol.h
    qmultimedia_common/mockmediacontainercontrol.h
    qmultimedia_common/mockmetadatawritercontrol.h
    qmultimedia_common/mockmetadatareadercontrol.h
    qmultimedia_common/mockmediaplayerservice.h
    qmultimedia_common/mockmediaplayercontrol.h
    qmultimedia_common/mockmediastreamscontrol.h
    qmultimedia_common/mockmedianetworkaccesscontrol.h
    qmultimedia_common/mockvideoprobecontrol.h
    qmultimedia_common/mockaudiorolecontrol.h
    qmultimedia_common/mockcustomaudiorolecontrol.h
    qmultimedia_common/mockmediaplayerservice.h
    qmultimedia_common/mockmediaplayercontrol.h
    qmultimedia_common/mockmediastreamscontrol.h
    qmultimedia_common/mockmedianetworkaccesscontrol.h
    qmultimedia_common/mockvideoprobecontrol.h
    qmultimedia_common/mockaudiorolecontrol.h
    qmultimedia_common/mockcustomaudiorolecontrol.h
    qmultimedia_common/mockmediaplaylistsourcecontrol.h
    qmultimedia_common/mockmediaplaylistcontrol.h
    qmultimedia_common/mockreadonlyplaylistprovider.h
    qmultimedia_common/mockplaylistservice.h
    qmultimedia_common/mockradiotunercontrol.h
    qmultimedia_common/mockradiodatacontrol.h
    qmultimedia_common/mockaudiodecoderservice.h
    qmultimedia_common/mockaudiodecodercontrol.h
)

set(EXCLUDE_SRC ${EXCLUDE_SRC}
    qmediaserviceprovider/mockserviceplugin1/mockserviceplugin1.cpp
    qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.cpp
    qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.cpp
    qmediaserviceprovider/mockserviceplugin4/mockserviceplugin4.cpp
    qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.cpp

    qmediaplaylist/tst_qmediaplaylist.cpp                       #SIGBUS(BUS_ADRALN)
    qsamplecache/tst_qsamplecache.cpp                           #Q_ASSERT(state() == Ready校验失败（qsamplecache_p.h：87）
    qmediaserviceprovider/tst_qmediaserviceprovider.cpp         #SIGSEGV(SEGV_MAPERR)
    qvideoframe/tst_qvideoframe.cpp                             #SIGSEGV(SEGV_MAPERR)
)

set(MANUAL_ADD_MAIN 0)
set(PLUGINS QOpenHarmonyPlatformIntegrationPlugin)
#整合测试项，生成测试库，名字当前工程名，即project(tst_qtcharts_auto)中定义的tst_qtcharts_auto
create_library(${TEST_ITEMS})
